package com.cqc.other.juc.volatil.demo2;


public class DataEntity {

    private volatile int count = 0;

    //方法1
    public void add() {
//    public synchronized void add() {
        for (int i = 0; i < 1000000; i++) {
            count++;
        }
    }


    public int getCount() {
        return count;
    }
}
